﻿
using Android.Graphics;
using Microsoft.Maui.Graphics.Platform;
using Path = System.IO.Path;
using RectF = Android.Graphics.RectF;

namespace LuoYangHuiPT;

public partial class MainPage : ContentPage
{

	public MainPage()
	{
		InitializeComponent();
	}

	private void OnCounterClicked(object sender, EventArgs e)
	{
        TakePhoto();
        //SemanticScreenReader.Announce(CounterBtn.Text);
    }
    public async void TakePhoto()
    {
        if (MediaPicker.Default.IsCaptureSupported)
        {
            FileResult photo = await MediaPicker.Default.PickPhotoAsync();

            if (photo != null)
            {
                // save the file into local storage
               ZiYuan.Path = Path.Combine(FileSystem.CacheDirectory, photo.FileName);
                gv.Invalidate();
            }
        }
    }
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void Button_Clicked(object sender, EventArgs e)
    {
        //Canvas
        //ImagePaint img = new ImagePaint();
        //img.dr
        //PlatformImage img =new PlatformImage(showPic.Source);
    }
}

